package controller

import (
	"github.com/gin-gonic/gin"
	"xinyu/model/res"
	"xinyu/myerr"
	"xinyu/service"
)

type testController struct {
	Srv service.ITestService
}

// @Tags 测试
// @Summary 测试接口
// @Description 用于测试数据库查询
// @Produce  json
// @Success 200 {object} model.CrmBanner "成功."
// @Failure 30001  "内部错误."
// @Router /test/ok [get]
func (ctl *testController) Test(ctx *gin.Context) {
	crmBanner := ctl.Srv.SelectByOne()
	res.SendResponse(ctx, myerr.OK, crmBanner)
	return
}

// @Tags 测试2
// @Summary 测试接口2
// @Description 用于测试数据库查询2
// @Produce  json
// @Success 200 {object} model.CrmBanner "成功."
// @Failure 30001  "内部错误."
// @Router /test/ok1 [get]
func (ctl *testController) Test2(ctx *gin.Context) {
	crmBanner := ctl.Srv.SelectByOne()
	res.SendResponse(ctx, myerr.OK, crmBanner)
	return
}
